from visualization import Visualization

from config import Opt

from models import Model
import torch

import argparse


parser = argparse.ArgumentParser(description='Baseline')

parser.add_argument('--input_path', type=str)
parser.add_argument('--output_path', type=str)

args = parser.parse_args()


config = Opt(args)
model = Model(config)
if config.gpu == -1:
    model.load_state_dict(torch.load(config.save_model_path,map_location='cpu')['dict'])
else:
    model.load_state_dict(torch.load(config.save_model_path)['dict'])

v = Visualization(config,model)

with open(args.input_path,'r',encoding='utf-8') as f:
    item = eval(f.read())

v.predict(item)

